/*
 * Copyright 2012-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot.web.server;

import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * 用于自定义 {@link WebServerFactory web 服务器工厂} 的策略接口。
 * 应用中此类型的任何 Bean 在服务器启动前都会收到回调，
 * 以便设置端口、地址、错误页面等配置。
 * <p>
 * 注意：此接口的调用通常来自 {@link WebServerFactoryCustomizerBeanPostProcessor}，
 * 它是一个 {@link BeanPostProcessor}，在 ApplicationContext 生命周期非常早期被调用。
 * 因此，建议在封闭的 BeanFactory 中延迟查找依赖，而非直接通过 {@code @Autowired} 注入，
 * 以避免过早依赖导致的问题。
 *
 * @param <T> 可配置的 Web 服务器工厂类型
 * @author Phillip Webb
 * @author Dave Syer
 * @author Brian Clozel
 * @since 2.0.0
 * @see WebServerFactoryCustomizerBeanPostProcessor
 */
@FunctionalInterface
public interface WebServerFactoryCustomizer<T extends WebServerFactory> {

	/**
	 * 自定义指定的 {@link WebServerFactory} 实例。
	 * @param factory 要自定义的 Web 服务器工厂
	 */
	void customize(T factory);

}
